<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="./index.css">
</head>
<body>
    <a href="#">button</a>
    <a href="#">button</a>
    <script>
        const buttons=document.querySelectorAll("a")
        buttons.forEach(item=>{
           item.addEventListener("click",function(e){
               console.log("hhh")
                let x=e.clientX-e.target.offsetLeft
                let y=e.clientY-e.target.offsetTop
                let ripper=document.createElement("span")
                ripper.style.left=x+"px"
                ripper.style.top=y+"px"
                this.appendChild(ripper)
                setTimeout(()=>{
                    ripper.remove()
                },1000)
           })

        })

    </script>
</body>
</html>